[stdlib] Add default values part 2 #14769
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
faulthandler- https://github.com/python/cpython/blob/main/Modules/faulthandler.chashlib- generic constructor, but all other functions haveusedforsecurity=Trueitertools.count- https://github.com/python/cpython/blob/8cfd7b4ecf9c01ca2bea57fe640250f716cb6ee3/Modules/itertoolsmodule.c#L3388itertools.accumulate- https://github.com/python/cpython/blob/8cfd7b4ecf9c01ca2bea57fe640250f716cb6ee3/Modules/itertoolsmodule.c#L2981itertools.islice- https://github.com/python/cpython/blob/8cfd7b4ecf9c01ca2bea57fe640250f716cb6ee3/Modules/itertoolsmodule.c#L1510itertools.zip_longest- https://github.com/python/cpython/blob/8cfd7b4ecf9c01ca2bea57fe640250f716cb6ee3/Modules/itertoolsmodule.c#L3908itertools.permutations- https://github.com/python/cpython/blob/8cfd7b4ecf9c01ca2bea57fe640250f716cb6ee3/Modules/itertoolsmodule.c#L2738multiprocessing- taken from parent classpickle.Pickler.__init__(self, file: SupportsWrite[bytes], protocol: int | None = None, ...)os.fdopen- arguments are passed toio.open, whose signature, judging by typeshed, is the same asbuiltins.openos.posix_spawn- https://github.com/python/cpython/blob/8cfd7b4ecf9c01ca2bea57fe640250f716cb6ee3/Modules/posixmodule.c#L7597os.posix_spawnp- https://github.com/python/cpython/blob/8cfd7b4ecf9c01ca2bea57fe640250f716cb6ee3/Modules/posixmodule.c#L7643os.copy_file_range- https://github.com/python/cpython/blob/8cfd7b4ecf9c01ca2bea57fe640250f716cb6ee3/Modules/posixmodule.c#L12501os.pidfd_open- https://github.com/python/cpython/blob/8cfd7b4ecf9c01ca2bea57fe640250f716cb6ee3/Modules/posixmodule.c#L10285os.splice- https://github.com/python/cpython/blob/8cfd7b4ecf9c01ca2bea57fe640250f716cb6ee3/Modules/posixmodule.c#L12565pstats.Stats- https://github.com/python/cpython/blob/8cfd7b4ecf9c01ca2bea57fe640250f716cb6ee3/Lib/pstats.py#L110sched.scheduler- https://github.com/python/cpython/blob/8cfd7b4ecf9c01ca2bea57fe640250f716cb6ee3/Lib/sched.py#L53select.kevent- https://github.com/python/cpython/blob/8cfd7b4ecf9c01ca2bea57fe640250f716cb6ee3/Modules/selectmodule.c#L1775select.epoll.__new__- https://github.com/python/cpython/blob/8cfd7b4ecf9c01ca2bea57fe640250f716cb6ee3/Modules/selectmodule.c#L1355select.epoll.__exit__- https://github.com/python/cpython/blob/8cfd7b4ecf9c01ca2bea57fe640250f716cb6ee3/Modules/selectmodule.c#L1706select.devpoll.poll- https://github.com/python/cpython/blob/8cfd7b4ecf9c01ca2bea57fe640250f716cb6ee3/Modules/selectmodule.c#L943ssl- even though default values use constants "aliases", I used enum values to work around flake8 errors. I also moved the functions below so that these objects are defined.syslog.openlog- https://github.com/python/cpython/blob/8cfd7b4ecf9c01ca2bea57fe640250f716cb6ee3/Modules/syslogmodule.c#L141timeit.Timer- https://github.com/python/cpython/blob/8cfd7b4ecf9c01ca2bea57fe640250f716cb6ee3/Lib/timeit.py#L101C57-L101C70timeit.timeit- https://github.com/python/cpython/blob/8cfd7b4ecf9c01ca2bea57fe640250f716cb6ee3/Lib/timeit.py#L231timeit.repeat- https://github.com/python/cpython/blob/8cfd7b4ecf9c01ca2bea57fe640250f716cb6ee3/Lib/timeit.py#L237zipfile- default values are taken fromio.TextIOWrapperinto which all arguments are passed